package diseaseandcureadministration.symptom;

import diseaseandcureadministration.registry.Registrable;

public class Symptom implements Registrable{
	
	private String _name;
	private SymptomSeverity _severity;
	
	public Symptom(String name, SymptomSeverity severity)
	{
		_name = name;
		_severity = severity;
	}
	
	public String getName()
	{
		return _name;
	}
	
	public SymptomSeverity getSeverity()
	{
		return _severity;
	}
	
	@Override
	public boolean equals(Object o)
	{
		boolean isEqual = false;
		
		if(o instanceof Symptom && o != null)
		{
			Symptom other = (Symptom) o;
			
			if(other.getName().equalsIgnoreCase(_name) && other.getSeverity().equals(_severity))
			{
				isEqual = true;
			}
		}		
		
		return isEqual;
	}
	
	@Override
	public String toString()
	{
		String symptomAsString = _name + ", " + _severity;
		return symptomAsString;
	}

}
